package eip.chapter3.pubsub.impl;

import java.util.List;

import org.apache.log4j.Logger;

import eip.chapter3.pubsub.HotelService;
import eip.chapter3.pubsub.RegulationUpdate;

/**
 * Implementation class for the receiving HotelService. This implementation
 * just prints out the received regulations.
 * 
 * @author nl24167
 */
public class HotelServiceImpl implements HotelService {
	
	private String name;
	private final static Logger LOG = Logger.getLogger(HotelServiceImpl.class);

	/**
	 * Print out the regulations to the logger.
	 */
	public void processRegulationUpdates(List<RegulationUpdate> updates) {
		LOG.info("Processing " + updates.size() + " for HotelService: " + getName());
		for (RegulationUpdate update : updates) {
			LOG.info("Received regulation update: " + update);	
		}
	}
	
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
}
